<?php include('head.php')?>
<style>

</style>
</head>
<body class="mainbody">
</body>
</html>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  $studio=$_POST['studio'];
  $name=$_POST['name'];
  $phone=$_POST['phone'];
  $suburb=$_POST['suburb'];
  $email=$_POST['email'];
  $date=$_POST['date'];
  $msg = $_POST['detail'];
  $message = "Name: " . $name . "\n" . "\n".
             "Phone: " . $phone . "\n" . "\n" .
             "Suburb: " . $suburb . "\n" . "\n" .
             "Email Address: " . $email . "\n" . "\n" .
             "Preferred Date: " . $date . "\n" . "\n" .
             "Additional Details: " . "\n" . $msg;

  if($studio=='sydney'){
    $to='sydney@dreamlife.net.au';
  }
  if($studio=='melbourne'){
    $to='melbourne@dreamlife.net.au';
  }
  if($studio=='brisbane'){
    $to='brisbane@dreamlife.net.au';
  }

  //$_SESSION["to"]=$to;
//  $to='ns.zhangjianxin@gmail.com';
  
  $header="From:".$name."<".$email.">";
  if (eregi("\r",$name) || eregi("\n",$name) || eregi("\r",$name) || eregi("\n",$name)){
       //die("Error occures :(!");
     }
  if($name!='' || $phone!=''){
    mail($to,'Dreamlife Enquiry',$message,$header);
  //mail('marco@plateau.co.nz','Dreamlife Enquiry'.$studio,$message,$header);
  }
}
?>